# employees = {
#     101: {
#         "name": "Alice",
#         "age": 30,
#         "gender": "Female",
#         "position": "Data Scientist",
#         "team": "Research",
#         "salary_history": [70000, 80000, 90000]
#     },
#     # 更多员工数据...
# }
#
# employees[102] = {
#     "name": "John",
#     "age": 50,
#     "gender": "Male",
#     "position": "Cleaner",
#     "team": "Clean",
#     "salary_history": [3000, 5000, 6000]
# }
#
# del employees[102]
#
# employees[101]["age"] = 31
#
# b = employees[101]["salary_history"]
# b.append(95000)
# s = 0
# for i in b:
#     s += i
# salary_ave = s / len(b)
# print(salary_ave)
#
# for i in employees.keys():
#     if employees[i]["age"] > 25:
#         print(i, employees[i]["name"])
#
# for i in employees.keys():
#     employees[i]["bonus"] = b[-1] * 0.1
#
# employees[101]["position"] = "Senior Data Scientist"
# for i in employees.keys():
#     employees[i].pop("gender")
# print(employees)


employees1 = {
    1: {
        "name": "张三",
        "position": ["Engineer", "Engineer2"],
        "age": 33,
        "use": 1
    },
    2: {
        "name": "李四",
        "position": ["Test Engineer", "Test Engineer2"],
        "age": 26,
        "use": 2
    },
    3: {
        "name": "王五",
        "position": ["Master", "Master2"],
        "age": 46,
        "use": 3
    }
}

employees1[4] = {
    "name": "John",
    "position": ["Cleaner", "Cleaner2"]
}

del employees1[4]

employees1[1]["name"] = "赵六"

employees1[1]["position"].append("Engineer3")

s = 0
for i in employees1.keys():
    s += employees1[i]["age"]
    avg = s / i
print(avg)
for i in employees1.keys():
    if employees1[i]["age"] > 2:
        print(i, employees1[i]["age"])

for i in employees1.keys():
    employees1[i]["bonus"] = employees1[i]["age"] * 0.1

for i in employees1.keys():
    employees1[i].pop("use")
print(employees1)